﻿using System.Data;

namespace Jin.Core.Schema
{
    /// <summary>
    /// 列接口
    /// </summary>
   public interface IColumn:IDBObject
    {
       /// <summary>
       /// 是否是外键
       /// </summary>
       bool IsForeignKey { get; set; }

       /// <summary>
       /// 所属表
       /// </summary>
       ITable Table { get; set; }
       /// <summary>
       /// 外键表
       /// </summary>
       ITable ForeignKeyTo { get; set; }
       /// <summary>
       /// 数据类型
       /// </summary>
       DbType DataType { get; set; }
       /// <summary>
       /// 最大值
       /// </summary>
       int MaxLength { get; set; }
       /// <summary>
       /// 是否为空
       /// </summary>
       bool IsNullable { get; set; }
       /// <summary>
       /// 是否只读
       /// </summary>
       bool IsReadOnly { get; set; }
       bool IsConputed { get; set; }
       /// <summary>
       /// 是否为自增
       /// </summary>
       bool AutoIncrement { get; set; }
       /// <summary>
       /// 获取数值列中小数点右边的位数
       /// </summary>
       int NumberScale { get; set; }

       /// <summary>
       /// 获取数值数据列中的位数
       /// </summary>
       int NumberPrecision { get; set; }

       /// <summary>
       /// 是否为主键
       /// </summary>
       bool IsPrimaryKey { get; set; }
       /// <summary>
       /// 默认设置
       /// </summary>
       object DefaultSetting { get; set; }
       /// <summary>
       /// 参数名称
       /// </summary>
       string ParameterName { get; }
       /// <summary>
       /// 属性名称
       /// </summary>
       string PropertyName { get; set; }

       /// <summary>
       /// 获取一个值,该值指示此实例是否数字
       /// </summary>
       bool IsNumeric { get; }

       /// <summary>
       /// 获取一个值,该值指示此实例是否时间
       /// </summary>
       bool IsDatrTime { get; }
       /// <summary>
       /// 获取一个值,该值指示此实例是否字符
       /// </summary>
       bool IsString { get; }
       /// <summary>
       /// 获取创建sql
       /// </summary>
       string CreateSql { get; }
       /// <summary>
       /// 跟新sql
       /// </summary>
       string AlterSql { get; }
       /// <summary>
       /// 删除sql
       /// </summary>
       string DeleterSql { get; }
    }
}
